import * as types from '@/store/mutation-types';

export default {
  state: {
    unflod: false,
    loginButton: false, //* loginButton 点击icon弹出来的框里面的登录按钮
    orderHistory: true, //* orderHistory 点击icon弹出来的框里面的历史订单
    logout: true, //* logout 点击icon弹出来的框里面的登出按钮
  },
  mutations: {
    //* 改变unflod
    [types.SHOW_USER_UNFLOD](state) {
      state.unflod = true;
    },
    [types.HIDE_USER_UNFLOD](state) {
      state.unflod = false;
    },

    //* 改变loginButton
    [types.SHOW_LOGIN_BUTTON](state) {
      state.loginButton = true;
    },
    [types.HIDE_LOGIN_BUTTON](state) {
      state.loginButton = false;
    },

    //* 改变orderHistory
    [types.SHOW_ORDER_HISTORY](state) {
      state.orderHistory = true;
    },
    [types.HIDE_ORDER_HISTORY](state) {
      state.orderHistory = false;
    },

  },
  actions: {

    // * 显示userUnflod
    showUserUnflod({ commit }) {
      commit(types.SHOW_USER_UNFLOD);
    },

    // * 隐藏userUnflod
    hideUserUnflod({ commit }) {
      commit(types.HIDE_USER_UNFLOD);
    },
  },
};
